import hashlib

def check_duplicates (user, feMsgList) :

    map = {}
    returnList = []
    for item in feMsgList :

        #hashVal = hash(item)
        hashVal = hashlib.md5()
        hashVal.update(item.fromUserName)
        hashVal.update(item.messageText)
        hashVal.digest()
        #print hashVal
        #print hashVal.digest()
        #if user != item.fromUserName :
        if not hashVal.digest() in map :
            #print 'Item Appended'
            map[hashVal.digest()] = ''
            returnList.append(item)
            #print map

    return returnList
